<?php
/**
 * Created by PhpStorm.
 * User: chenshenglin
 * Date: 2020/5/11
 * Time: 9:54 AM
 * 后台路由管理
 */

Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
    //登录页面
    Route::get('login', 'LoginController@index')->name('admin.login');
    //登录
    Route::post('login', 'LoginController@submit')->name('admin.login');

    Route::group(['middleware' => ['check_admin_login']], function () {
        //退出
        Route::get('logout', 'LoginController@logout')->name('admin.logout');
        //首页
        Route::get('index', 'IndexController@index')->name('admin.index');
        //欢迎页面
        Route::get('welcome', 'IndexController@welcome')->name('admin.welcome');

        Route::get('user/index', 'UserController@index')->name('admin.user.index');
        Route::get('user/add', 'UserController@create')->name('admin.user.create');
    });
});